<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PU2CLR RDA5807 Arduino Library: Tools method</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="LOGO.png"/></td>
  <td id="projectalign">
   <div id="projectname">PU2CLR RDA5807 Arduino Library<span id="projectnumber">&#160;1.1.8</span>
   </div>
   <div id="projectbrief">Arduino Library for RDA5807 Devices - By Ricardo Lima Caratti</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group___g05.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Tools method</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2275869d5ec1bd0eaea2e278e2a70cc7"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g05.html#ga2275869d5ec1bd0eaea2e278e2a70cc7">RDA5807::formatFrequency</a> (uint16_t value, char *strValue, char decimalSeparator)</td></tr>
<tr class="memdesc:ga2275869d5ec1bd0eaea2e278e2a70cc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a numeric frequency to a formated string (char *) frequency.  <br /></td></tr>
<tr class="separator:ga2275869d5ec1bd0eaea2e278e2a70cc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43c6c86481dd1fdba0fc14438bc8e18e"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g05.html#ga43c6c86481dd1fdba0fc14438bc8e18e">RDA5807::formatCurrentFrequency</a> (char decimalSeparator=',')</td></tr>
<tr class="memdesc:ga43c6c86481dd1fdba0fc14438bc8e18e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the current frequency to a formated string (char *) frequency.  <br /></td></tr>
<tr class="separator:ga43c6c86481dd1fdba0fc14438bc8e18e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f40d75452088ceeffb4d8969fb34999"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g05.html#ga0f40d75452088ceeffb4d8969fb34999">RDA5807::convertToChar</a> (uint16_t value, char *strValue, uint8_t len, uint8_t dot, uint8_t separator, bool remove_leading_zeros=true)</td></tr>
<tr class="memdesc:ga0f40d75452088ceeffb4d8969fb34999"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts a number to a char array.  <br /></td></tr>
<tr class="separator:ga0f40d75452088ceeffb4d8969fb34999"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga16f6ef1f816a032fb07a91017c34bb50"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g05.html#ga16f6ef1f816a032fb07a91017c34bb50">RDA5807::checkI2C</a> (uint8_t *addressArray)</td></tr>
<tr class="memdesc:ga16f6ef1f816a032fb07a91017c34bb50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check the I2C bus address.  <br /></td></tr>
<tr class="separator:ga16f6ef1f816a032fb07a91017c34bb50"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>A set of functions used to support other functions </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2275869d5ec1bd0eaea2e278e2a70cc7" name="ga2275869d5ec1bd0eaea2e278e2a70cc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2275869d5ec1bd0eaea2e278e2a70cc7">&#9670;&#160;</a></span>formatFrequency()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">char * RDA5807::formatFrequency </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>strValue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>decimalSeparator</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert a numeric frequency to a formated string (char *) frequency. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint16_t</td><td>value - A given frequency to be formated </td></tr>
    <tr><td class="paramname">char</td><td>*strValue - Formated frequency (Exe: 103,90) - Array of char ( minimal 7 elements ) </td></tr>
    <tr><td class="paramname">char</td><td>decimalSeparator - the symbol that separates the decimal part (Exe: . or ,) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>point of strValue </dd></dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8h_source.html#l01006">1006</a> of file <a class="el" href="_r_d_a5807_8h_source.html">RDA5807.h</a>.</p>

</div>
</div>
<a id="ga43c6c86481dd1fdba0fc14438bc8e18e" name="ga43c6c86481dd1fdba0fc14438bc8e18e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga43c6c86481dd1fdba0fc14438bc8e18e">&#9670;&#160;</a></span>formatCurrentFrequency()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">char * RDA5807::formatCurrentFrequency </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>decimalSeparator</em> = <code>','</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert the current frequency to a formated string (char *) frequency. </p>
<p>The current frequency is the latest setted frequency by setFrequency, seek, setFrequencyUp and setFrequencyDown. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">char</td><td>decimalSeparator - the symbol that separates the decimal part (Exe: . or ,) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>point char string strFrequency (member variable) </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___g_a03.html#gad16a6afa9520b77498b17a72c226305a" title="Sets the frequency.">setFrequency</a>, <a class="el" href="group___g_a03.html#ga87de696f0a40724c19c89b6b48766020" title="Seek function.">seek</a>, <a class="el" href="group___g_a03.html#ga4e8db177fea475ea00fa04e3d8f1f08c" title="Increments the current frequency.">setFrequencyUp</a> and <a class="el" href="group___g_a03.html#gadba771c864ace7a8373a76554b9d3e6a" title="Decrements the current frequency.">setFrequencyDown</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8h_source.html#l01020">1020</a> of file <a class="el" href="_r_d_a5807_8h_source.html">RDA5807.h</a>.</p>

<p class="reference">References <a class="el" href="_r_d_a5807_8h_source.html#l00603">RDA5807::strFrequency</a>.</p>

</div>
</div>
<a id="ga0f40d75452088ceeffb4d8969fb34999" name="ga0f40d75452088ceeffb4d8969fb34999"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0f40d75452088ceeffb4d8969fb34999">&#9670;&#160;</a></span>convertToChar()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::convertToChar </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>strValue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>dot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>separator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>remove_leading_zeros</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts a number to a char array. </p>
<p>It is useful to mitigate memory space used by functions like sprintf or othetr generic similar functions</p>
<p>You can use it to format frequency using decimal or tousand separator and also to convert smalm numbers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>value to be converted </td></tr>
    <tr><td class="paramname">strValue</td><td>char array that will be receive the converted value </td></tr>
    <tr><td class="paramname">len</td><td>final string size (in bytes) </td></tr>
    <tr><td class="paramname">dot</td><td>the decimal or tousand separator position </td></tr>
    <tr><td class="paramname">separator</td><td>symbol "." or "," </td></tr>
    <tr><td class="paramname">remove_leading_zeros</td><td>if true removes up to two leading zeros (default is true) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01301">1301</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
<a id="ga16f6ef1f816a032fb07a91017c34bb50" name="ga16f6ef1f816a032fb07a91017c34bb50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga16f6ef1f816a032fb07a91017c34bb50">&#9670;&#160;</a></span>checkI2C()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int RDA5807::checkI2C </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>addressArray</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check the I2C bus address. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>address Array - this array will be populated with the I2C bus addresses found (minimum three elements) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if no i2c device is found; -1 if error is found or n &gt; 0, where n is the number of I2C bus address found </dd></dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01338">1338</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
